package com.itheima.day07.demo05;

public class Test {
    public static void main(String[] args) {
        Student student = new Student("d", "mm", 11);

        String sex = student.getSex();
        Integer age = student.getAge();

        try {
            if (sex.equals("女")) {

                System.out.println("输入正确");
            }

        } catch (SexException e) {
            System.out.println("输入有误");

        }


        try {
            if (sex.equals("男")) {

                System.out.println("输入正确");
            }

        } catch (SexException e) {
            System.out.println("输入有误");
        }

        try {
            if (age > 50 || age < 15) {
                System.out.println("年龄错误");
            }
        } catch (AgeException e) {
            e.printStackTrace();
        }



    }

}
